-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SurfaceMountingManager leaking views from stopped surfaces #37964
Conversation
This pull request was exported from Phabricator. Differential Revision: D46840717 |
…ook#37964) Summary: Pull Request resolved: facebook#37964 When a Surface is stopped, we don't immediately destroy the SurfaceMountingManager but instead just tear down its internal state. This allows for better error handling (eg did this react tag ever exist, or is this non-existing tag). The way we construct the set of tags post-deletion is flawed though: `mTagToViewState.keySet()` does not create a new Set with all the tags used, but instead uses the underlying HashMap to iterate over the keys as needed. This effectively keeps all the Views inside that deleted surface alive. Changelog: [Android][Fixed] Surfaces in the new architecture no longer leak views once stopped Reviewed By: sammy-SC, rshest Differential Revision: D46840717 fbshipit-source-id: aafab0e550bdfd19e561e282c5baba81e97d2082
577befc
to
6a6ab6a
Compare
This pull request was exported from Phabricator. Differential Revision: D46840717 |
…ook#37964) Summary: Pull Request resolved: facebook#37964 When a Surface is stopped, we don't immediately destroy the SurfaceMountingManager but instead just tear down its internal state. This allows for better error handling (eg did this react tag ever exist, or is this non-existing tag). The way we construct the set of tags post-deletion is flawed though: `mTagToViewState.keySet()` does not create a new Set with all the tags used, but instead uses the underlying HashMap to iterate over the keys as needed. This effectively keeps all the Views inside that deleted surface alive. Changelog: [Android][Fixed] Surfaces in the new architecture no longer leak views once stopped Reviewed By: sammy-SC, rshest Differential Revision: D46840717 fbshipit-source-id: 9fca7af8ec43be410655c747ac6915d0e1f169b3
6a6ab6a
to
59a9f36
Compare
This pull request was exported from Phabricator. Differential Revision: D46840717 |
Base commit: 936936c |
…ook#37964) Summary: Pull Request resolved: facebook#37964 When a Surface is stopped, we don't immediately destroy the SurfaceMountingManager but instead just tear down its internal state. This allows for better error handling (eg did this react tag ever exist, or is this non-existing tag). The way we construct the set of tags post-deletion is flawed though: `mTagToViewState.keySet()` does not create a new Set with all the tags used, but instead uses the underlying HashMap to iterate over the keys as needed. This effectively keeps all the Views inside that deleted surface alive. Changelog: [Android][Fixed] Surfaces in the new architecture no longer leak views once stopped Reviewed By: sammy-SC, rshest Differential Revision: D46840717 fbshipit-source-id: 925cd526e79ed9152ee0c1b289cded50163c1393
59a9f36
to
e6bb7af
Compare
This pull request was exported from Phabricator. Differential Revision: D46840717 |
…ook#37964) Summary: Pull Request resolved: facebook#37964 When a Surface is stopped, we don't immediately destroy the SurfaceMountingManager but instead just tear down its internal state. This allows for better error handling (eg did this react tag ever exist, or is this non-existing tag). The way we construct the set of tags post-deletion is flawed though: `mTagToViewState.keySet()` does not create a new Set with all the tags used, but instead uses the underlying HashMap to iterate over the keys as needed. This effectively keeps all the Views inside that deleted surface alive. Changelog: [Android][Fixed] Surfaces in the new architecture no longer leak views once stopped Reviewed By: sammy-SC, rshest Differential Revision: D46840717 fbshipit-source-id: 582e55203ae706e6c86eec1f34ad42b10abd50f6
This pull request was exported from Phabricator. Differential Revision: D46840717 |
e6bb7af
to
ea160cd
Compare
This pull request has been merged in c16e993. |
Summary:
When a Surface is stopped, we don't immediately destroy the SurfaceMountingManager but instead just tear down its internal state. This allows for better error handling (eg did this react tag ever exist, or is this non-existing tag).
The way we construct the set of tags post-deletion is flawed though:
mTagToViewState.keySet()
does not create a new Set with all the tags used, but instead uses the underlying HashMap to iterate over the keys as needed. This effectively keeps all the Views inside that deleted surface alive.Changelog: [Android][Fixed] Surfaces in the new architecture no longer leak views once stopped
Differential Revision: D46840717